package com.security.utils;

import com.security.vo.ResultVo;

public class ResultVoUtils {
    public static <T> ResultVo<T> success(T object){
        ResultVo<T> resultVo = new ResultVo<>();
        resultVo.setCode(0);
        resultVo.setMsg("success");
        resultVo.setData(object);
        return resultVo;
    }

    public static <T> ResultVo<T> success(){
        return success(null)
    }

    public static <T> ResultVo<T> fail(Integer code, String msg){
        ResultVo<T> resultVo = new ResultVo<>();
        resultVo.setCode(code);
        resultVo.setMsg(msg);
        resultVo.setData(null);
        return resultVo;
    }
}
